<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
		<meta charset="utf-8">
		<title>淘天机站群系统管理后台</title>
		<!-- include header_meta -->
</head>

<body>
	<!-- include header -->
	<div class="cp-wrap {if $jnarrow}jnarrow{/if}">
		<div class="crumb"></div>
		<div class="themes">
			<!--foreach $themes $key $v-->
			<div class=" ws fl cl">
				<div class="preview">
					<img src="{$v[preview]}" alt="">
					<div class="tplnamebg"></div>
					<div class="tplname">{$v[name]}({$key})</div>
				</div>
				<div class="engine">
					<select name="themeselect" class="themeselect" onchange="changeEngine('{$key}', options[selectedIndex].value)" style="width:180px">
						<option value="default" {if $v[engine]=='default'}selected="selected"{/if}>默认引擎</option>
						<option value="dedecms" {if $v[engine]=='dedecms'}selected="selected"{/if}>织梦模板引擎</option>
					</select>
				</div>
			</div>
			<!--/foreach-->
		</div>
	</div>
	<!-- include footer -->

	<style>
		.fl{float:left;}
		.themes{ padding-left: 30px; padding-top: 10px;}
		.themes .ws{ width:180px; height:250px; margin:20px; }
		.themes .ws .preview{ position: relative; }
		.themes .ws .preview img{width:180px;height:180px; border: 1px solid #ddd; }
		.themes .ws .tplnamebg{ position: absolute; bottom: 0px; height:30px; line-height: 30px; background:#000; width: 182px; opacity:0.5; }
		.themes .ws .tplname{ position: absolute; bottom: 0px; height:30px; line-height: 30px; width: 177px; color: #FFF; overflow: hidden; padding-left: 5px; }
		.themes .ws .engine{ padding-top: 5px; }
		.wrap{ width: 1400px; margin:0 auto;  height:700px;line-height:700px;padding-top: 160px;}
	</style>
	<script>
		$('select[name=themeselect]').select2({ minimumResultsForSearch: -1 });
		function changeEngine(theme, tplengine) {
			$.get("?m=theme&a=updateTplEngine&theme="+theme+"&engine="+tplengine, function(rs){
				if(rs=='success'){
					cpAlert("模板引擎切换成功");
				}else{
					cpAlert("未完成，请检查模板缓存目录是否有清理权限", 0);
				}
			});
		}
	</script>
</body>
</html>